
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.game.GameCanvas;

public class GameOver extends GameCanvas {

    private Player player;

    public GameOver() {
        super(false);
        setFullScreenMode(true);
    }

    public void play(Player player) {
        this.player = player;

        Graphics g = getGraphics();

        g.setColor(0);
        g.fillRect(0, 0, getWidth(), getHeight());

        
        g.setColor(0x00ff50);
        g.drawString("Game Over", (getWidth() - g.getFont().stringWidth("Game Over")) / 2, (getHeight() - g.getFont().getHeight()) / 2, 0);
        g.drawString(player.getPontos() + " Pontos", (getWidth() - g.getFont().stringWidth(player.getPontos() + " Pontos")), (getHeight() - g.getFont().getHeight()) - 2, 0);
        flushGraphics();

        try {
            Thread.sleep(3000);
        } catch (InterruptedException ex) {
        }
    }

    public void keyPressed(int keycode) {
        new Recordes().check(player);
    }

    protected void pointerPressed(int x, int y) {
        new Recordes().check(player);
    }

}
